{% extends 'myhome/index.html' %}

{% block title %}
<title>{{data.title}}</title>
{% endblock %}

{% block css %}
<link type="text/css" href="/static/myhome/css/optstyle.css" rel="stylesheet" />
<link type="text/css" href="/static/myhome/css/style.css" rel="stylesheet" />
{% endblock %}

{% block js %}
<script type="text/javascript" src="/static/myhome/AmazeUI-2.4.2/assets/js/amazeui.js"></script>
<script type="text/javascript" src="/static/myhome/js/jquery.imagezoom.min.js"></script>
<script type="text/javascript" src="/static/myhome/js/jquery.flexslider.js"></script>
<script type="text/javascript" src="/static/myhome/js/list.js"></script>
{% endblock%}

{% block con %}
<b class="line"></b>
<div class="listMain">
    <!--分类-->
    <div class="nav-table">
        <div class="long-title">
            <span class="all-goods">全部分类</span></div>
        <div class="nav-cont">
            <ul>
                <li class="index">
                    <a href="{% url 'myhome_index' %}">首页</a></li>
                <li class="qc">
                    <a href="#">闪购</a></li>
                <li class="qc">
                    <a href="#">限时抢</a></li>
                <li class="qc">
                    <a href="#">团购</a></li>
                <li class="qc last">
                    <a href="#">大包装</a></li>
            </ul>
            <div class="nav-extra">
                <i class="am-icon-user-secret am-icon-md nav-user"></i>
                <b>
                </b>我的福利
                <i class="am-icon-angle-right" style="padding-left: 10px;"></i>
            </div>
        </div>
    </div>
    <ol class="am-breadcrumb am-breadcrumb-slash">
        <li>
            <a href="{% url 'myhome_index' %}">首页</a></li>
        <li>
            <a href="">分类</a></li>
        <li class="am-active">内容</li>
    </ol>
    <script type="text/javascript">$(function() {});
        $(window).load(function() {
            $('.flexslider').flexslider({
                animation: "slide",
                start: function(slider) {
                    $('body').removeClass('loading');
                }
            });
        });
    </script>
    <div class="scoll">
        <section class="slider">
            <div class="flexslider" style="">
                <div class="flex-viewport" style="overflow: hidden; position: relative;">
                    <ul class="slides" style="width: 1000%; transition-duration: 0s; transform: translate3d(0px, 0px, 0px);">
                        <li class="clone" aria-hidden="true" style="width: 0px; float: left; display: block;">
                            <img src="/static/myhome/images/03.jpg" draggable="false"></li>
                        <li style="width: 0px; float: left; display: block;" class="flex-active-slide">
                            <img src="/static/myhome/images/01.jpg" title="pic" draggable="false"></li>
                        <li style="width: 0px; float: left; display: block;">
                            <img src="/static/myhome/images/02.jpg" draggable="false"></li>
                        <li style="width: 0px; float: left; display: block;">
                            <img src="/static/myhome/images/03.jpg" draggable="false"></li>
                        <li style="width: 0px; float: left; display: block;" class="clone" aria-hidden="true">
                            <img src="/static/myhome/images/01.jpg" title="pic" draggable="false"></li>
                    </ul>
                </div>
                <ol class="flex-control-nav flex-control-paging">
                    <li>
                        <a class="flex-active">1</a></li>
                    <li>
                        <a>2</a>
                    </li>
                    <li>
                        <a>3</a>
                    </li>
                </ol>
                <ul class="flex-direction-nav">
                    <li class="flex-nav-prev">
                        <a class="flex-prev" href="#">Previous</a></li>
                    <li class="flex-nav-next">
                        <a class="flex-next" href="#">Next</a></li>
                </ul>
            </div>
        </section>
    </div>
    <!--放大镜-->
    <div class="item-inform">
        <div class="clearfixLeft" id="clearcontent">
            <div class="box">
                <script type="text/javascript">$(document).ready(function() {
                        $(".jqzoom").imagezoom();
                        $("#thumblist li a").click(function() {
                            $(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
                            $(".jqzoom").attr('src', $(this).find("img").attr("mid"));
                            $(".jqzoom").attr('rel', $(this).find("img").attr("big"));
                        });
                    });</script>
                <div class="tb-booth tb-pic tb-s310">
                    <a href="{{ data.pic_url }}">
                        <img src="{{ data.pic_url }}" alt="细节展示放大镜特效" rel="{{ data.pic_url }}" class="jqzoom" style="cursor: crosshair;"></a>
                </div>
                <ul class="tb-thumb" id="thumblist">
                    <li class="tb-selected">
                        <div class="tb-pic tb-s40">
                            <a href="#">
                                <img src="{{ data.pic_url }}" mid="{{ data.pic_url }}" big="{{ data.pic_url }}"></a>
                        </div>
                    </li>                   
                </ul>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clearfixRight">
            <!--规格属性-->
            <!--名称-->
            <div class="tb-detail-hd">
                <h1>{{ data.title }}</h1></div>
            <div class="tb-detail-list">
                <!--价格-->
                <div class="tb-detail-price">
                    <li class="price iteminfo_price">
                        <dt>促销价</dt>
                        <dd>
                            <em>¥</em>
                            <b class="sys_item_price">{{ data.price }}</b></dd>
                    </li>
                    <li class="price iteminfo_mktprice">
                        <dt>原价</dt>
                        <dd>
                            <em>¥</em>
                            <b class="sys_item_mktprice">{{ wdata.price }}</b></dd>
                    </li>
                    <div class="clear"></div>
                </div>
                <!--地址-->
                <dl class="iteminfo_parameter freight">
                                <dt>配送至</dt>
                                <div class="iteminfo_freprice">
                                    <div class="am-form-content address">
                                        <select data-am-selected>
                                            <option value="a">浙江省</option>
                                            <option value="b">湖北省</option>
                                        </select>
                                        <select data-am-selected>
                                            <option value="a">温州市</option>
                                            <option value="b">武汉市</option>
                                        </select>
                                        <select data-am-selected>
                                            <option value="a">瑞安区</option>
                                            <option value="b">洪山区</option>
                                        </select>
                                    </div>
                                    <div class="pay-logis">
                                        快递<b class="sys_item_freprice">10</b>元
                                    </div>
                                </div>
                            </dl>
                <div class="clear"></div>
                <!--销量-->
                <ul class="tm-ind-panel">
                    <li class="tm-ind-item tm-ind-sellCount canClick">
                        <div class="tm-indcon">
                            <span class="tm-label">浏览量</span>
                            <span class="tm-count">{{data.clicknum}}</span></div>
                    </li>
                    <li class="tm-ind-item tm-ind-sumCount canClick">
                        <div class="tm-indcon">
                            <span class="tm-label">累计销量</span>
                            <span class="tm-count">{{data.ordernum}}</span></div>
                    </li>
                </ul>
                <div class="clear"></div>
                <!--各种规格-->
                <dl class="iteminfo_parameter sys_item_specpara">
                    <dt class="theme-login">
                        <div class="cart-title">可选规格
                            <span class="am-icon-angle-right"></span></div>
                    </dt>
                    <dd>
                        <!--操作页面-->
                        <div class="theme-popover-mask"></div>
                        <div class="theme-popover">
                            <div class="theme-span"></div>
                            <div class="theme-poptit">
                                <a href="javascript:;" title="关闭" class="close">×</a></div>
                            <div class="theme-popbod dform">
                                <form class="theme-signin" name="loginform" action="" method="post">
                                    <div class="theme-signin-left">
                                        <div class="theme-options">
                                            <div class="cart-title">口味</div>
                                            <ul>
                                                <li class="sku-line selected">原味
                                                    <i></i>
                                                </li>
                                                <li class="sku-line">奶油
                                                    <i></i>
                                                </li>
                                                <li class="sku-line">炭烧
                                                    <i></i>
                                                </li>
                                                <li class="sku-line">咸香
                                                    <i></i>
                                                </li>
                                            </ul>
                                        </div>
                                        <div class="theme-options">
                                            <div class="cart-title">包装</div>
                                            <ul>
                                                <li class="sku-line selected">手袋单人份
                                                    <i></i>
                                                </li>
                                                <li class="sku-line">礼盒双人份
                                                    <i></i>
                                                </li>
                                                <li class="sku-line">全家福礼包
                                                    <i></i>
                                                </li>
                                            </ul>
                                        </div>
                                        <div class="theme-options">
                                            <div class="cart-title number">数量</div>
                                            <dd>
                                                <input id="min" class="am-btn am-btn-default" name="" type="button" value="-" disabled="disabled">
                                                <input id="text_box" name="" type="text" value="1" style="width:30px;">
                                                <input id="add" class="am-btn am-btn-default" name="" type="button" value="+">
                                                <span id="Stock" class="tb-hidden">库存
                                                    <span class="stock">{{data.store}}</span>件</span></dd>
                                        </div>
                                        <div class="clear"></div>
                                        <div class="btn-op">
                                            <div class="btn am-btn am-btn-warning">确认</div>
                                            <div class="btn close am-btn am-btn-warning">取消</div></div>
                                    </div>
                                    <div class="theme-signin-right">
                                        <div class="img-info">
                                            <img src="/static/myhome/images/songzi.jpg"></div>
                                        <div class="text-info">
                                            <span class="J_Price price-now">¥39.00</span>
                                            <span id="Stock" class="tb-hidden">库存
                                                <span class="stock">1000</span>件</span></div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </dd>
                </dl>
                <div class="clear"></div>
                <!--活动 -->
                <div class="shopPromotion gold">
                    <div class="hot">
                        <dt class="tb-metatit">店铺优惠</dt>
                        <div class="gold-list">
                            <p>购物满2件打8折，满3件7折
                                <span>点击领券
                                    <i class="am-icon-sort-down"></i></span>
                            </p>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="coupon">
                        <dt class="tb-metatit">优惠券</dt>
                        <div class="gold-list">
                            <ul>
                                <li>125减5</li>
                                <li>198减10</li>
                                <li>298减20</li></ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="pay">
                <div class="pay-opt">
                    <a href="home.html">
                        <span class="am-icon-home am-icon-fw">首页</span></a>
                    <a>
                        <span class="am-icon-heart am-icon-fw">收藏</span></a>
                </div>
                <li>
                    <div class="clearfix tb-btn tb-btn-buy theme-login">
                        <a id="LikBuy" title="点此按钮到下一步确认购买信息" href="#">立即购买</a></div>
                </li>
                <li>
                    <div class="clearfix tb-btn tb-btn-basket theme-login">
                        <a id="LikBasket" gid={{data.id}} title="加入购物车" href="javascript:void(0)">
                            <i></i>加入购物车</a>
                    </div>
                </li>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
    <!-- introduce-->
    <div class="introduce">
        <div class="browse">
            <div class="mc">
                <ul>
                    <div class="mt">
                        <h2>看了又看</h2>
                    </div>
                    {% for g in goodsdata %}
                    {% if g.id != data.id %}
                        <li class="first">
                            <div class="p-img">
                                <a href="#">
                                    <img class="" src="{{ g.pic_url }}">
                                </a>
                            </div>
                            <div class="p-name">
                                <a href="#">{{ g.title }}</a></div>
                            <div class="p-price">
                                <strong>￥{{ g.price }}</strong></div>
                        </li>
                    {% endif %}
                    {% endfor %}
                </ul>
            </div>
        </div>
        <div class="introduceMain">
            <div class="am-tabs" data-am-tabs="">
                <ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs" otop="997.0499877929688">
                    <li class="am-active">
                        <a href="#">
                            <span class="index-needs-dt-txt">宝贝详情</span></a>
                    </li>
                    <li>
                        <a href="#">
                            <span class="index-needs-dt-txt">全部评价</span></a>
                    </li>
                    <li>
                        <a href="#">
                            <span class="index-needs-dt-txt">猜你喜欢</span></a>
                    </li>
                </ul>
                <!-- 宝贝详情 -->
                <div class="am-tabs-bd" style="touch-action: pan-y; user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
                    <div class="am-tab-panel am-fade am-in am-active">
                        {{ data.info|safe }}
                        <div class="clear"></div>
                    </div>
                    <!-- 评论 -->
                    <div class="am-tab-panel am-fade">
                        <div class="actor-new">
                            <div class="rate">
                                <strong>100
                                    <span>%</span></strong>
                                <br>
                                <span>好评度</span></div>
                            <dl>
                                <dt>买家印象</dt>
                                <dd class="p-bfc">
                                    <q class="comm-tags">
                                        <span>味道不错</span>
                                        <em>(2177)</em></q>
                                    <q class="comm-tags">
                                        <span>颗粒饱满</span>
                                        <em>(1860)</em></q>
                                    <q class="comm-tags">
                                        <span>口感好</span>
                                        <em>(1823)</em></q>
                                    <q class="comm-tags">
                                        <span>商品不错</span>
                                        <em>(1689)</em></q>
                                    <q class="comm-tags">
                                        <span>香脆可口</span>
                                        <em>(1488)</em></q>
                                    <q class="comm-tags">
                                        <span>个个开口</span>
                                        <em>(1392)</em></q>
                                    <q class="comm-tags">
                                        <span>价格便宜</span>
                                        <em>(1119)</em></q>
                                    <q class="comm-tags">
                                        <span>特价买的</span>
                                        <em>(865)</em></q>
                                    <q class="comm-tags">
                                        <span>皮很薄</span>
                                        <em>(831)</em></q>
                                </dd>
                            </dl>
                        </div>
                        <div class="clear"></div>
                        <div class="tb-r-filter-bar">
                            <ul class=" tb-taglist am-avg-sm-4">
                                <li class="tb-taglist-li tb-taglist-li-current">
                                    <div class="comment-info">
                                        <span>全部评价</span>
                                        <span class="tb-tbcr-num">(32)</span></div>
                                </li>
                                <li class="tb-taglist-li tb-taglist-li-1">
                                    <div class="comment-info">
                                        <span>好评</span>
                                        <span class="tb-tbcr-num">(32)</span></div>
                                </li>
                                <li class="tb-taglist-li tb-taglist-li-0">
                                    <div class="comment-info">
                                        <span>中评</span>
                                        <span class="tb-tbcr-num">(32)</span></div>
                                </li>
                                <li class="tb-taglist-li tb-taglist-li--1">
                                    <div class="comment-info">
                                        <span>差评</span>
                                        <span class="tb-tbcr-num">(32)</span></div>
                                </li>
                            </ul>
                        </div>
                        <div class="clear"></div>
                        <ul class="am-comments-list am-comments-list-flip">
                            <li class="am-comment">
                                <!-- 评论容器 -->
                                <a href="">
                                    <img class="am-comment-avatar" src="/static/myhome/images/hwbn40x40.jpg">
                                    <!-- 评论者头像 --></a>
                                <div class="am-comment-main">
                                    <!-- 评论内容容器 -->
                                    <header class="am-comment-hd">
                                        <!--<h3 class="am-comment-title">评论标题</h3>-->
                                        <div class="am-comment-meta">
                                            <!-- 评论元数据 -->
                                            <a href="#link-to-user" class="am-comment-author">b***1 (匿名)</a>
                                            <!-- 评论者 -->评论于
                                            <time datetime="">2015年11月02日 17:46</time></div>
                                    </header>
                                    <div class="am-comment-bd">
                                        <div class="tb-rev-item " data-id="255776406962">
                                            <div class="J_TbcRate_ReviewContent tb-tbcr-content ">摸起来丝滑柔软，不厚，没色差，颜色好看！买这个衣服还接到诈骗电话，我很好奇他们是怎么知道我买了这件衣服，并且还知道我的电话的！</div>
                                            <div class="tb-r-act-bar">颜色分类：柠檬黄&nbsp;&nbsp;尺码：S</div></div>
                                    </div>
                                    <!-- 评论内容 --></div>
                            </li>
                        </ul>
                        <div class="clear"></div>
                        <!--分页 -->
                        <ul class="am-pagination am-pagination-right">
                            <li class="am-disabled">
                                <a href="#">«</a></li>
                            <li class="am-active">
                                <a href="#">1</a></li>
                            <li>
                                <a href="#">2</a></li>
                            <li>
                                <a href="#">3</a></li>
                            <li>
                                <a href="#">4</a></li>
                            <li>
                                <a href="#">5</a></li>
                            <li>
                                <a href="#">»</a></li>
                        </ul>
                        <div class="clear"></div>
                        <div class="tb-reviewsft">
                            <div class="tb-rate-alert type-attention">购买前请查看该商品的
                                <a href="#" target="_blank">购物保障</a>，明确您的售后保障权益。</div></div>
                    </div>
                    <!-- 推荐商品 -->
                    <div class="am-tab-panel am-fade">
                        <div class="like">
                            <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
                                <li>
                                    <div class="i-pic limit">
                                        <img src="/static/myhome/images/imgsearch1.jpg">
                                        <p>【良品铺子_开口松子】零食坚果特产炒货
                                            <span>东北红松子奶油味</span></p>
                                        <p class="price fl">
                                            <b>¥</b>
                                            <strong>298.00</strong></p>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        <div class="clear"></div>
                        <!--分页 -->
                        <ul class="am-pagination am-pagination-right">
                            <li class="am-disabled">
                                <a href="#">«</a></li>
                            <li class="am-active">
                                <a href="#">1</a></li>
                            <li>
                                <a href="#">2</a></li>
                            <li>
                                <a href="#">3</a></li>
                            <li>
                                <a href="#">4</a></li>
                            <li>
                                <a href="#">5</a></li>
                            <li>
                                <a href="#">»</a></li>
                        </ul>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
            <div class="footer">
                <div class="footer-hd">
                    <p>
                        <a href="#">恒望科技</a>
                        <b>|</b>
                        <a href="#">商城首页</a>
                        <b>|</b>
                        <a href="#">支付宝</a>
                        <b>|</b>
                        <a href="#">物流</a></p>
                </div>
                <div class="footer-bd">
                    <p>
                        <a href="#">关于恒望</a>
                        <a href="#">合作伙伴</a>
                        <a href="#">联系我们</a>
                        <a href="#">网站地图</a>
                        <em>© 2015-2025 Hengwang.com 版权所有</em></p>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#LikBasket').click(function(){
        //判断是否登录
        var VipUser = '{{ request.session.VipUser }}'
        if(!VipUser){
            // 没有登录
            alert('请先登录');
            return;
        }
        // 获取商品id和商品数量
        var gid = $(this).attr('gid')
        var num = $('#text_box').val()
        // 发送ajax请求
        $.get('{% url 'myhome_cartadd' %}',{'gid':gid,'num':num},function(data){
            alert(data['msg'])
        },'json')
    })
</script>
{% endblock %}